typedef HRESULT (WINAPI *TD3DXCreateTextureFromFileExW)(
  _In_     LPDIRECT3DDEVICE9 pDevice,
  _In_     LPCTSTR pSrcFile,
  _In_     UINT Width,
  _In_     UINT Height,
  _In_     UINT MipLevels,
  _In_     DWORD Usage,
  _In_     D3DFORMAT Format,
  _In_     D3DPOOL Pool,
  _In_     DWORD Filter,
  _In_     DWORD MipFilter,
  _In_     D3DCOLOR ColorKey,
  _Inout_  D3DXIMAGE_INFO *pSrcInfo,
  _Out_    PALETTEENTRY *pPalette,
  _Out_    LPDIRECT3DTEXTURE9 *ppTexture
);

TD3DXCreateTextureFromFileExW  OldD3DXCreateTextureFromFileExW;

DllExport HRESULT cc D3DXCreateTextureFromFileExW(
  _In_     LPDIRECT3DDEVICE9 pDevice,
  _In_     LPCTSTR pSrcFile,
  _In_     UINT Width,
  _In_     UINT Height,
  _In_     UINT MipLevels,
  _In_     DWORD Usage,
  _In_     D3DFORMAT Format,
  _In_     D3DPOOL Pool,
  _In_     DWORD Filter,
  _In_     DWORD MipFilter,
  _In_     D3DCOLOR ColorKey,
  _Inout_  D3DXIMAGE_INFO *pSrcInfo,
  _Out_    PALETTEENTRY *pPalette,
  _Out_    LPDIRECT3DTEXTURE9 *ppTexture
)
{
	//Log((LPCSTR)pSrcFile, wcslen(pSrcFile));
	Beep(1000, 100);
	Beep(2000, 100);
	Beep(3000, 100);
	Beep(4000, 100);
	return OldD3DXCreateTextureFromFileExW(pDevice, pSrcFile, Width, Height,MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette,ppTexture);
}
